#include <stdio.h>

/*
 * whoopsies °_-_°
 */

int
main(void)
{
	int cur, k;
	int prev, cont = -1;
	int result = 0;

	scanf("%d", &k);

	while (scanf("%d", &cur) == 1) {
		if (prev == cur) {
			if (cont != -1)
				cont++;
		} else {
			cont = 1;
		}

		if (cont != -1 && cont > k || k == 0) {
			result++;
			cont = -1;
		}

		prev = cur;
	}

	printf("%d\n", result);

	return 0;
}
